#include<iostream>
using namespace std;
#include<string>
int main(){
	string a;
	cin>>a;
	for(int i=0;i<(a.size());i++){
		if((a[i]>'0') && (a[i]<='9')){
			for(int j=0;j<(a[i]-'0');j++){
				cout<<a[i-1];
			}
		}
		else if((a[i]<'0') || (a[i]>'9')){
			if((a[i+1]<'0') || (a[i+1]>'9')){
				cout<<a[i];
			}
			continue;
		}
	}
}
